package com.lk.utils;

import java.io.IOException;
import java.util.Properties;

/**
 * 获取properties文件的工具
 */
public class PropertiesUtil {
    static Properties properties = new Properties();

    public static boolean loadFile(String fileName){
        try {
            //传入一个输入流
            properties.load(PropertiesUtil.class.getClassLoader().getResourceAsStream(fileName));
        }catch (IOException e) {
            return false;
        }
        return true;
    }

    public static String getPropertyValue(String key){
        String value = properties.getProperty(key);
        return value;
    }
}